package com.leet.code.lcof;

public class Code46 {

    public static void main(String[] args) {
        Code46 code46 = new Code46();
        int i = code46.translateNum(12512);
        System.out.println(i);
    }

    public int translateNum(int num) {
        int n = num;
        int i = 1;
        while ((n = n / 10) > 0) {
            i++;
        }

        int[] nums = new int[i];

        while (i > 0) {
            i--;
            nums[i] = num % 10;
            num = num / 10;
        }

        int sum = 1;
        int a1 = 1, a2 = 1;
        for (int j = 1; j < nums.length; j++) {

            if (nums[j - 1] * 10 + nums[j] <= 25 && nums[j - 1] != 0) {
                sum = a1 + a2;
                a2 = a1;
                a1 = sum;
            } else {
                a2 = sum;
            }

        }

        return sum;
    }

    public int dfs(int[] is, int i, int p) {
        if (i == is.length) {
            return p;
        }
        if (i == is.length - 1) {

        }

        return 0;
    }


}
